using System;

public class Program1
{
    public static void TestPrint1()
    {
        string[] input = Console.ReadLine().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        if (input.Length != 3 || 
            !int.TryParse(input[0], out int x) || 
            !int.TryParse(input[1], out int y) || 
            !int.TryParse(input[2], out int z))
        {
            Console.WriteLine("输入格式错误，请输入三个有效的整数！");
            return;
        }
        int[] numbers = { x, y, z };
        Array.Sort(numbers);
        Console.WriteLine("排序后的结果（从小到大）：");
        Console.WriteLine($"{numbers[0]} {numbers[1]} {numbers[2]}");
    }
    
    
    public static void TestPrint2()
    {
        int sum = 0;
        Console.WriteLine("1-100之间所有不是7的倍数且不包含7的数字：");
        
        for (int i = 1; i <= 100; i++)
        {
            if (i % 7 != 0 && i % 10 != 7 && i / 10 != 7)
            {
                Console.Write(i + " ");
                sum += i;
            }
        }
        
        Console.WriteLine("\n这些数字的总和是：" + sum);
    }
    
    
    
    
    public static void TestPrint3()
    {
        Console.WriteLine("九九乘法表：");
        for (int i = 1; i <= 9; i++)
        {
            for (int j = 1; j <= i; j++)
            {
                Console.Write($"{j}×{i}={i * j}\t");
            }
            Console.WriteLine();
        }
    }
    
    
    
    public static void TestPrint4()
    {
        Console.WriteLine("1000以内的完数有：");
        for (int num = 2; num <= 1000; num++)
        {
            int factorSum = 0;  
            
            for (int i = 1; i <= num / 2; i++) 
            {
                if (num % i == 0)
                {
                    factorSum += i;
                }
            }
            if (factorSum == num)
            {
                Console.Write(num + " ");
            }
        }
        Console.WriteLine();
    }
    
    
    public static void TestPrint5()
    {
        Console.WriteLine("请输入一个正整数：");
        string input = Console.ReadLine();
        if (!int.TryParse(input, out int number) || number <= 0)
        {
            Console.WriteLine("输入错误，请输入有效的正整数！");
            return;
        }
        int digitCount = input.Length;
        Console.WriteLine($"该数是 {digitCount} 位数");
        Console.Write("逆序打印各位数字：");
        for (int i = input.Length - 1; i >= 0; i--)
        {
            Console.Write(input[i] + " ");
        }
        Console.WriteLine();
    }
    
    
    
    public static void TestPrint6()
    {
        Console.WriteLine("请输入菱形的行数（必须为正奇数）：");
        if (!int.TryParse(Console.ReadLine(), out int rows) || rows <= 0 || rows % 2 == 0)
        {
            Console.WriteLine("输入错误，请输入有效的正奇数！");
            return;
        }

        int half = rows / 2;
        for (int i = 0; i <= half; i++)
        {
            for (int j = 0; j < half - i; j++)
            {
                Console.Write(" ");
            }
            for (int k = 0; k < 2 * i + 1; k++)
            {
                Console.Write("*");
            }
            Console.WriteLine(); 
        }

        for (int i = half - 1; i >= 0; i--)
        {
            for (int j = 0; j < half - i; j++)
            {
                Console.Write(" ");
            }

            for (int k = 0; k < 2 * i + 1; k++)
            {
                Console.Write("*");
            }

            Console.WriteLine();
        }
    }
}